package net.shop.action.member;

import javax.servlet.http.HttpServletRequest;

import ths.web.action.ActionContext;
import ths.web.action.ActionException;
import ths.web.action.Result;
import ths.web.action.result.ResultView;
import ths.web.annotation.HttpAction;
import ths.web.session.Session;
import ths.web.session.SessionManagerHelper;
import ths.web.util.CookieUtils;

@HttpAction("member")
public class MyOrderAction extends BaseMemberAction {

	public Result execute() throws ActionException {
		ActionContext context = ActionContext.getContext();
		HttpServletRequest request = context.getRequest();
		
		Session session = SessionManagerHelper.getSession(context);
		String captcha = session.getAttribute("captcha");
		if (captcha != null) {
			System.out.println(captcha);
		}
				
		
		String token = CookieUtils.getCookieValue(request, "login_token");
		System.out.println(token);
		
		
		
		ResultView view = getViewResult(context);
		view.assign("namespace", getNamespace());
		
		return view.toView("my_order");
	}

}
